home *** CD-ROM | disk | FTP | other *** search
- {$R-}
- {
- GetPVolume -- An HyperCard XFCN that will return the volume of the speaker
- as it is stored in the parameter RAM.
-
- Written by Steven Kienle, CIS account number 72330,111
-
- GetPVolume should be called in HyperCard as
- GetPVolume()
- The parentheses are required.
-
- After compiling this program, link it with the GetPVolume.Link, then use
- ResEdit to move the XFCN resource to the appropriate stack. Or use the
- GetPVolume/SetVolume stack's Install button.
-
- NOTE: for the XCmdGlue.inc file to work with TML Pascal, a few
- modifications are required.
- }
-
- {$S GetPVolume } { Segment name must be the same as the command name. }
-
- UNIT DummyUnit;
-
- INTERFACE
-
- USES MacIntf, HyperXCmd;
-
- PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
-
- IMPLEMENTATION
-
- PROCEDURE GetPVolume(paramPtr: XCmdPtr); FORWARD;
-
- PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
- BEGIN
- GetPVolume(paramPtr);
- END;
-
- PROCEDURE GetPVolume(paramPtr: XCmdPtr);
- VAR
- loldVolume : LongInt ;
- pasStr : Str255 ;
- theParams : SysPPtr ;
-
- {$I XCmdGlue.inc }
-
- BEGIN
- theParams := GetSysPPtr ; { Get the volume from the Parameter RAM }
- loldVolume := BitAnd(theParams^.volClik,$0700) DIV $0100 ;
- pasStr := NumToStr(loldVolume) ; { Convert number to string }
- paramPtr^.returnValue := PasToZero(pasStr) ; { Return the value }
- END;
-
-
- END.
-
-